{% extends "base.html" %}

{% block content %}
<div id="admintable">
<a href="/editdocument">Add New Document</a>
<table>
    <tr class="table_header"><td >Date</td><td>Posted By</td>
    <td>Title</td>
    <td>Categories</td><td>Published?</td></tr>
{% for document in documents %}
<tr class="table_row"><td>{{ document.date|date:"D, M d Y" }}</td><td>{{ document.postedby }}</td><td><a href="/editdocument?key={{ document.key }}">{{ document.title }}</a></td><td>
{% for category in document.categories %}
{{ category }}{% if not forloop.last %}, {% endif %}
{% endfor %}</td>
<td>{% if document.published %}Yes{% else %}No{% endif %}</td>
</tr>
{% endfor %}
</table>
</div>
{% endblock %}